import { defineStore } from "pinia";
import Cookies from "js-cookie"
export const useAppStore = defineStore("app", {
  state() {
    return {
      sidebar: {
        opened: Cookies.get("sedebarStatus")?!!Number(Cookies.get("sedebarStatus")):true,
      },
    };
  },
  getters: {},
  actions: {
    toggleSidebar() {
      this.sidebar.opened = !this.sidebar.opened;
      Cookies.set("sedebarStatus",Number(this.sidebar.opened)+"")
    },
  },
});
